<template>
	<view class="bigbox">
		<view class="title">
			<view>Hi，{{login.realname}}</view>
			<view  class="fot11">{{login.post}}</view>
		</view>
		<!-- 不是银行专员的时候 -->
		<view v-if="sta">
			<view class="box1" v-if="list1[0] != undefined">
				<image src="../../static/1.png" mode=""></image>
				<view v-for="item in list1" @click="order_tz(item.query01)">
					<view>{{item.query02}}</view>
					<view class="fot1">{{item.query08}}<text style="font-size: 24rpx;"></text></view>
				</view>
			</view>
			<view class="title1">
				<view class="line"></view>
				<view>我的待办</view>
			</view>
			<view class="box2">
				<view class="box2_1" v-for="item in list2" @click="order_tz(item)">
					<view>
						<view>{{item.query06}}</view>
						<view class="fot2">{{item.query02}}</view>
					</view>
					<image :src="item.query03" mode=""></image>
				</view>
			</view>
			<view class="title1">
				<view class="line"></view>
				<view>业务进件</view>
			</view>
			<view class="box3" v-for="item in list3" @click="ywjj(item)">
				<!-- <view class="box3_1">{{item.query13}}%</view> -->
				<view class="box3_2">
					<!-- <view>{{item.query02}}</view> -->
					<view class="box3_1" style="color: #000000;">{{item.query02}}</view>
					<view class="box3_3">立即申请</view>
				</view>
				<view class="box3_4">{{item.query06}}</view>
			</view>
			<view class="title1">
				<view class="line"></view>
				<view>常用工具</view>
			</view>
			<view class="box4">
				<view v-for="item in list4" @click="gj_tz(item)">
					<image :src="item.query03" mode=""></image>
					<view>{{item.query02}}</view>
				</view>
			</view>
		</view>
		<!-- 银行专员的暂无权限 -->
		<view class="zwqx" v-if="sta == 0">暂无权限</view>
			
			
	</view>
</template>

<script>
	export default {
		data() {
			return {
				login:'',
				list1:[],
				list2:[],
				list3:[],
				list4:[],
				sta:1
			}
		},
		onPullDownRefresh() {
			//监听下拉刷新动作的执行方法，每次手动下拉刷新都会执行一次
			console.log('refresh');
			this.initial()
			setTimeout(function () {
				uni.stopPullDownRefresh();  //停止下拉刷新动画
				uni.showToast({
					title:'刷新成功',
					icon:'none'
				})
			}, 1000);
		},
		mounted() {
			this.initial()
			console.log(uni.getStorageSync('login').post)
			if(uni.getStorageSync('login').post == '银行专员'){
				this.sta = 0
			}
		},
		methods: {
			gj_tz:function(item){
				console.log(item.query04,item.query02)
				uni.navigateTo({
					url:"../webview/webview?url=" + item.query04 + '&title=' + item.query02
				})
			},
			ywjj:function(item){
				console.log(item)
				uni.navigateTo({
					url:'../jiandang/jiandang?item=' + JSON.stringify(item)
				})
			},
			order_tz:function(item){
				console.log(item)
				uni.navigateTo({
					url:'../yewu_order/yewu_order?type=' + item.query01 + '&title=' + item.query02
				})
			},
			initial:function(){
				this.login = uni.getStorageSync('login')
				// 顶部
				this.$get('report/fxjReport_01/list').then((res)=>{
					this.list1 = [res.data.result.records[0],res.data.result.records[1],res.data.result.records[2],]
					// console.log(this.list1)
				})
				// 我的待办
				this.$get('report/fxjReport_02/list').then((res)=>{
					console.log(res.data.result.records)
					this.list2 = res.data.result.records
				})
				// 业务进件
				this.$get('base/fxjBase_10/list').then((res)=>{
					this.list3 = res.data.result.records
				})
				// 常用工具
				this.$get('base/fxjBase_05/list',{
					pageSize:999,
					pageNo:1
				}).then((res)=>{
					console.log(res.data.message)
					if(res.data.message == 'org.apache.shiro.authc.AuthenticationException: Token失效，请重新登录'){
						uni.showToast({
							title:'登录过去,请重新登录！'
						})
						uni.clearStorageSync();
						setTimeout(()=>{
							uni.reLaunch({
								url:'../login/login'
							})
						},2000)
					}
					this.list4 = res.data.result.records
				})
				
			}
		}
	}
</script>

<style>
	.zwqx{
		height: 500rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 50rpx;
		font-weight: bold;
	}
	.fot11{
		/* width:110rpx; */
		height:35rpx;
		margin-top: 10rpx;
		padding: 0 10rpx;
		box-sizing: border-box;
		margin-left: 10rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		background:linear-gradient(120deg,rgba(58,98,255,1),rgba(86,157,255,1));
		border-radius:16rpx;
		font-size:16rpx;
		font-family:PingFang SC;
		font-weight:500;
		color:rgba(255,255,255,1);
	}
	.box4>view>image{
		width: 83rpx;
		height: 83rpx;
		margin-bottom: 18rpx;
	}
	.box4>view{
		width: 25%;
		margin-bottom: 40rpx;
		text-align: center;
		font-size:24rpx;
		font-family:PingFang SC;
		font-weight:500;
		color:rgba(58,61,73,1);
	}
	.box4{
		display: flex;
		justify-content: flex-start;
		align-items: center;
		flex-wrap: wrap;
	}
	.box3_4{
		width:200rpx;
		height:40rpx;
		background:rgba(255,163,116,0.12);
		font-size:24rpx;
		font-family:PingFang SC;
		font-weight:500;
		color:#FFA374;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.box3_3{
		width:190rpx;
		height:56rpx;
		background:linear-gradient(120deg,rgba(58,98,255,1),rgba(86,157,255,1));
		border-radius:28rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size:32rpx;
		font-family:PingFang SC;
		font-weight:500;
		color:rgba(255,255,255,1);
	}
	.box3_2{
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin: 10rpx 0;
		margin-bottom: 80rpx;
		font-size:28rpx;
		font-family:PingFang SC;
		font-weight:500;
		color:rgba(102,102,102,0.8);
	}
	.box3_1{
		font-size:50rpx;
		font-family:PingFang SC;
		font-weight:bold;
		color:rgba(254,56,5,1);
	}
	.box3{
		height:235rpx;
		padding: 20rpx 31rpx;
		box-sizing: border-box;
		background:rgba(255,255,255,1);
		border-radius:10rpx;
		box-shadow: 1rpx 2rpx 10rpx #cccccc;
		margin-bottom: 30rpx;
	}
	.box2_1>image{
		width: 88rpx;
		height: 88rpx;
	}
	.fot2{
		font-size:24rpx;
		font-family:PingFang SC;
		font-weight:500;
		color:rgba(153,153,153,1);
	}
	.box2_1{
		width: 47.8%;
		height: 134rpx;
		background:rgba(252,249,252,1);
		border-radius:10rpx;
		font-size:36rpx;
		font-family:PingFang SC;
		font-weight:bold;
		color:rgba(51,51,51,1);
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0 30rpx;
		box-sizing: border-box;
		margin-bottom: 18rpx;
	}
	.box2{
		display: flex;
		justify-content: space-between;
		align-items: center;
		flex-wrap: wrap;
		margin-bottom: 40rpx;
	}
	.line{
		width:8rpx;
		height:30rpx;
		background:linear-gradient(120deg,rgba(58,98,255,1),rgba(86,157,255,1));
		border-radius:4rpx;
		margin-right: 11rpx;
	}
	.title1{
		display: flex;
		justify-content: flex-start;
		align-items: center;
		font-size:30rpx;
		font-family:PingFang SC;
		font-weight:bold;
		color:rgba(51,51,51,1);
		margin-bottom: 30rpx;
	}
	.fot1{
		font-size:52rpx;
		font-family:PingFang SC;
		font-weight:bold;
		color:rgba(255,255,255,1);
	}
	.box1>image{
		width: 100%;
		height: 100%;
		position: absolute;
		top: 0;
		left: 0;
		z-index: -1;
	}
	.box1{
		width: 100%;
		height: 243rpx;
		display: flex;
		justify-content: space-around;
		align-items: center;
		position: relative;
		z-index: 10;
		font-size:30rpx;
		font-family:PingFang SC;
		font-weight:500;
		color:rgba(255,255,255,1);
	}
	.title{
		width: 100%;
		/* height: 120rpx; */
		/* border: 1px solid red; */
		background: #FFFFFF;
		font-size:36rpx;
		font-family:PingFang SC;
		font-weight:bold;
		color:rgba(51,51,51,1);
		padding: 30rpx;
		padding-top: calc(var(--status-bar-height) + 30rpx);
		box-sizing: border-box;
		display: flex;
		justify-content: flex-start;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 100;
	}
	.bigbox{
		padding: 30rpx;
		padding-top: calc(var(--status-bar-height) + 140rpx);
		box-sizing: border-box;
	}
</style>
